{extend name="public/common-base"/}


{block name="main"}
<div class="child-pin-1">
	<div class="in-public">
		<ul class="clearfix">
			<?php if(!empty($discount)){ foreach($discount as $k=>$v){?>
			<li>
				<a href="<?=url('index/goods/goodsDetail',['goods_id'=>$v['getGoods']['goods_id']])?>">
                        <span class="child-pin-1-li-span1">
                            <img src="/<?=$v['getGoods']['original_img']?>" alt="" />
                            <i></i>
                        </span>

					<h2>
						<div class="data-box dateShow1" data-date="<?=date('Y/m/d H:i:s',$v['end_time'])?>">
							<span>还剩</span>
							<span class="date-tiem d">00</span>天
							<span class="date-tiem h">00</span>时
							<span class="date-tiem m">00</span>分
							<span class="date-s s">00</span>秒
						</div>
					</h2>
					<strong class="child-pin-1-li-strong1"><?=$v['getGoods']['goods_name']?></strong>
					<h3 class="clearfix child-pin-1-li-h3-1">
						<strong class=" child-pin-1-li-h3-strong1">
							<div class="clearfix">
								<span>折扣价:</span>
								<b><?=$v['getGoods']['shop_price'] * $v['rate']/100?></b>
							</div>
						</strong>
						<strong class="clearfix child-pin-1-li-h3-strong2">
							<div class="clearfix">
								<span>原价:</span>
								<b><?=$v['getGoods']['shop_price']?></b>
								<i></i>
							</div>
						</strong>

					</h3>
				</a>
				<h3 class="clearfix child-pin-1-li-h3-2">
					<a href="<?=url('index/goods/goodsDetail',['goods_id'=>$v['getGoods']['goods_id']])?>" class="clearfix child-pin-1-li-h3-a2">立即抢购</a>
				</h3>
			</li>
			<?php }}  ?>
		</ul>
	</div>
</div>

<script type="text/javascript">
	$(function(){
		$(".child-pin-1 ul li:nth-child(4n+4)").addClass("active-45");
	})
</script>
<!--倒计时-->
<script src="/static/index/js/leftTime.min.js"></script>
<script type="text/javascript">
	$(function(){
		//日期倒计时,现在距离下面的日期
		var data_show = $('.data-box');
		for(var i=1;i<=data_show.length;i++){
			function_name($(".dateShow"+i).data("date"),".dateShow"+i);
		}
		// function_name('2018/02/22 23:45:24','.data-show-box');
		// function_name('2018/02/20 21:43:55','.data-show-box');
		function function_name(time,obj) {
			$.leftTime(time,function(d){
				if(d.status){
					var $dateShow1=$(obj);
					$dateShow1.find(".d").html(d.d);
					$dateShow1.find(".h").html(d.h);
					$dateShow1.find(".m").html(d.m);
					$dateShow1.find(".s").html(d.s);
				}
			});
		}
	});
</script>
<!--倒计时结束-->
{/block}